package com.sphd.beautysalon.presenter;


import com.android.volley.VolleyError;
import com.sphd.beautysalon.info.JiFenGiveInfo;
import com.sphd.beautysalon.model.JifenRechageSettingModelImpl;
import com.sphd.beautysalon.view.JifenRechageSettingView;

/**
* Created by Hu on 2016/12/21
*/

public class JifenRechageSettingPresenterImpl implements JifenRechageSettingPresenter{
    JifenRechageSettingModelImpl jifenRechageSettingModel;
    JifenRechageSettingView jifenRechageSettingView;

    public JifenRechageSettingPresenterImpl(JifenRechageSettingView jifenRechageSettingView) {
        this.jifenRechageSettingView = jifenRechageSettingView;
        jifenRechageSettingModel=new JifenRechageSettingModelImpl();
    }

    @Override
    public void addData(String url) {
        jifenRechageSettingView.showLoading();
        jifenRechageSettingModel.sendUrl(url,this);
    }

    @Override
    public void sendError(VolleyError error) {
            jifenRechageSettingView.dissLoading();
    }

    @Override
    public void recJiFenGiveInfo(JiFenGiveInfo jiFenGiveInfo) {
        jifenRechageSettingView.recJiFenGiveInfo(jiFenGiveInfo);
        jifenRechageSettingView.dissLoading();
    }

    @Override
    public void setSwitchRes(String url) {
        jifenRechageSettingView.showLoading();
        jifenRechageSettingModel.sendResUrl(url,this);
    }

    @Override
    public void recRes(int res) {
        jifenRechageSettingView.recRes(res);
        jifenRechageSettingView.dissLoading();
    }
}